package com.example.springbootdemo.mapper;

import com.example.springbootdemo.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user where username =#{username}")
    List<User> CheckUserName(@Param("username") String username);
    @Insert("insert into user values (null,#{username},#{password},#{email},#{phone},#{sex})")
    int Insert(User user);
    @Select("select * from user where username=#{username} and password=#{password}")
    List<User> Login(@Param("username") String username,@Param("password") String password);
}
